package com.xps.charmingshop.view.fragment;

import android.content.Intent;
import android.support.v4.app.FragmentTransaction;
import android.view.View;

import com.xps.charmingshop.R;
import com.xps.charmingshop.view.activity.HistoryActivity;
import com.xps.charmingshop.view.activity.ReckoningActivity;
import com.xps.charmingshop.view.base.BaseFragment;
import com.zhy.autolayout.AutoLinearLayout;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by MI on 2018/1/10.
 */

public class BillFragment extends BaseFragment {
    @BindView(R.id.Layour_Reckoning)
    AutoLinearLayout LayourReckoning;
    @BindView(R.id.Layout_AllBills)
    AutoLinearLayout LayoutAllBills;
    Unbinder unbinder;

    @Override
    protected int getRes() {
        return R.layout.fragment_bill;
    }

    @Override
    protected void init(View view) {
        unbinder = ButterKnife.bind(this, view);
    }

    @Override
    protected void setData(View view) {

    }

    @Override
    public void onClick(View v) {
    }

    public void hide() {
        FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
        fragmentTransaction.addToBackStack(null);
        fragmentTransaction.hide(this);
        fragmentTransaction.commit();
    }


    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @OnClick({R.id.Layour_Reckoning, R.id.Layout_AllBills})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.Layour_Reckoning:
                startActivity(new Intent(getActivity(), ReckoningActivity.class));
                break;
            case R.id.Layout_AllBills:
                startActivity(new Intent(getActivity(), HistoryActivity.class));
                break;
        }
    }
}
